CHILD_PROP_ICON_NAME,
CHILD_PROP_NEEDS_ATTENTION,
CHILD_PROP_VISIBLE,
+ CHILD_PROP_USE_UNDERLINE,
LAST_CHILD_PROP
};
char *name;
char *title;
char *icon_name;
- gboolean needs_attention;
- gboolean visible;
GtkWidget *last_focus;
+ guint needs_attention : 1;
+ guint visible : 1;
+ guint use_underline : 1;
};
typedef struct _GtkStackPageClass GtkStackPageClass;
g_value_set_boolean (value, gtk_stack_page_get_visible (info));
break;
+ case CHILD_PROP_USE_UNDERLINE:
+ g_value_set_boolean (value, info->use_underline);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
gtk_stack_page_set_visible (info, g_value_get_boolean (value));
break;
+ case CHILD_PROP_USE_UNDERLINE:
+ if (info->use_underline != g_value_get_boolean (value))
+ {
+ info->use_underline = g_value_get_boolean (value);
+ g_object_notify_by_pspec (object, pspec);
+ }
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
TRUE,
GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
+ stack_child_props[CHILD_PROP_USE_UNDERLINE] =
+ g_param_spec_boolean ("use-underline",
+ P_("Use underline"),
+ P_("If set, an underline in the title indicates the next character should be used for the mnemonic accelerator key"),
+ FALSE,
+ GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
+
g_object_class_install_properties (object_class, LAST_CHILD_PROP, stack_child_props);
}
static void
rebuild_child (GtkWidget *self,
const gchar *icon_name,
- const gchar *title)
+ const gchar *title,
+ gboolean use_underline)
{
GtkWidget *button_child;
else if (title != NULL)
{
button_child = gtk_label_new (title);
+ gtk_label_set_use_underline (GTK_LABEL (button_child), use_underline);
gtk_widget_set_tooltip_text (GTK_WIDGET (self), NULL);
gchar *icon_name;
gboolean needs_attention;
gboolean visible;
+ gboolean use_underline;
g_object_get (page,
"title", &title,
"icon-name", &icon_name,
"needs-attention", &needs_attention,
"visible", &visible,
+ "use-underline", &use_underline,
NULL);
- rebuild_child (button, icon_name, title);
+ rebuild_child (button, icon_name, title, use_underline);
gtk_widget_set_visible (button, visible && (title != NULL || icon_name != NULL));